/**
 * @Author: yy
 * @Date: 2019/6/20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-10-13 15:18:32
 */
import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';
//  查询列表
export const queryPotenCusOEM = params => axios.get(`${SERVER.CLUECENTER}/jk/clue/serchClue`, { params });
//  新增编辑潜客
export const addNewClues = params => axios.post(`${SERVER.CLUECENTER}/jk/clue/editClue`, params);
//  编辑经销商
export const updateDealers = params => axios.post(`${SERVER.CLUECENTER}/jk/clue/editOwnerCode`, params);
//  跳转编辑页面
export const getClueById = id => axios.get(`${SERVER.CLUECENTER}/jk/clue/getClueById?id=${id}`, { id: Number(id) });
// 发送清洗
export const sendCleaningINFO = id => axios.get(`${SERVER.CLUECENTER}/jk/clue/sendCC?clueIds=${id}`, { id: Number(id) });
// 热度定义
export const getTemperatureList = params => axios.get(`${SERVER.CYXDMS_CLUE}/basedata/clueHeatSetup/getHeatSetUp`, { params });

// 下载模板    https://kfcyx.yycsy.com/download/OEM_MODEL.xlsx
export const downloadTemplate = params => axios.get(`${SERVER.CLUECENTER}/jk/clue/downloadClueModel`, { params });
// 导入
export const importClues = params => axios.post(`${SERVER.CLUECENTER}/jk/clue/importClueByExcel`, params);
// 更新线索
export const updateClues = params => axios.post(`${SERVER.CLUECENTER}/jk/clue/updClues`, params);
// 导出
export const exportClues = params => {
  return axios({
    url: `${SERVER.CLUECENTER}/jk/clue/exportClueByExcel`,
    method: 'get',
    params: params,
    responseType: 'blob',
    //60分钟
    timeout: 10 * 1000 * 60
  });
};

// 导出报表
export const exportClueReport = params => {
  return axios({
    url: `${SERVER.CLUECENTER}/jk/clue/exportClueReport`,
    method: 'get',
    params: params,
    responseType: 'blob',
    //60分钟
    timeout: 10 * 1000 * 60
  });
};

//  查询列表
export const verifications = params => axios.get(`${SERVER.CLUECENTER}/jk/clue/verifications`, { params });

// 导出
export const exportFollow = params => {
  return axios({
    url: `${SERVER.CYXDMS_CLUE}/actioned/exportFollowByExcel`,
    method: 'get',
    params: params,
    responseType: 'blob',
    //10分钟
    timeout: 10 * 1000 * 60
  });
};

//根据条件判断线索是否存在
export const judgmentBYQueryCondition = params => axios.get(`${SERVER.CLUECENTER}/jk/clue/judgmentBYQueryCondition`, { params });

export const clueReport = params => axios.get(`${SERVER.CLUECENTER}/jk/clue/clueReport`, { params });

export const clueReportNew = params => axios.get(`${SERVER.CLUECENTER}/jk/clue/clueReportNew`, { params });
//获取map接口
export const getMapCmsInfo = params => axios.post(`${SERVER.CLUECENTER}/mapCms/getMapCmsInfo`, params);
// / 导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);

